﻿#region Copyright and License
/*==============================================================================
 *  Copyright (c) cndotnet.org Corporation.  All rights reserved.
 * ===============================================================================
 * This code and information is provided "as is" without warranty of any kind,
 * either expressed or implied, including but not limited to the implied warranties
 * of merchantability and fitness for a particular purpose.
 * ===============================================================================
 * Licensed under the GNU General Public License (GPL) v2
 * http://www.cndotnet.org/ucenter
 * ==============================================================================*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UCenter.Models;
using System.Data.Linq;

namespace UCenter.DataProvider
{
    #region IAccountRepository
    /// <summary>
    /// The interface of accout repository
    /// </summary>
    public interface IAccountRepository:IRepository<User>
    {
        #region Insert Methods
        /// <summary>
        /// Inserts the user.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <returns></returns>
        User InsertUser(User user);
        #endregion

        #region Update Methods
        /// <summary>
        /// Changes the password.
        /// </summary>
        /// <param name="email">The email.</param>
        /// <param name="oldPassword">The old password.</param>
        /// <param name="newPassword">The new password.</param>
        /// <returns></returns>
        bool ChangePassword(string email, string oldPassword, string newPassword);


        /// <summary>
        /// change user's online info
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="online"></param>
        void UpdateOnline(int userID, bool online);

        /// <summary>
        /// set status of one user
        /// </summary>
        /// <param name="userID">user id</param>
        /// <param name="status">status</param>
        void SetStatus(int userID, string status);

        /// <summary>
        /// update user logourl
        /// </summary>
        /// <param name="userID">user id</param>
        /// <param name="userLogo">logo url</param>
        void UpdateUserLogo(int userID, string userLogo);

        /// <summary>
        /// update profile info
        /// </summary>
        /// <param name="p"></param>
        void UpdateProfile(Profile p);
        #endregion 
    }
    #endregion
}
